public class test5 {
    static void main() {
        int[] arr = {12, 3, 31, 341};
    boolean flag=contains(arr,31);
        System.out.println(flag);
    }

    static boolean contains(int[] arr, int num) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == num) {
                return true;
            }
        }
        return false;
    }
}
